<template>
  <div>
    <scrolling-navbar>
      <template v-slot:nav-text="{ isScrolled }">
        <span
          v-if="!isScrolled"
          class="nav-item-hover"
          @mouseover="showHoverEffect"
          @mouseout="hideHoverEffect"
        >
          E特尔诺免费API--接口搬运工
        </span>
        <span v-else>QQ音乐接口</span>
      </template>
    
      
      <!-- 这里是您的内容区域，可以滚动以触发导航栏变化 -->
      <div class="content">
        
      
     

      </div>
    </scrolling-navbar>
  </div>
</template>
  
  <script>
import ScrollingNavbar from "@/components/views/components/ScrollingNavbar.vue";

export default {
  
    data() {
    return {
      showLargeCapsule: false,
    };
  },
  methods: {
    showHoverEffect(e) {
      e.target.classList.add('hover-effect-visible');
      this.showLargeCapsule = true;
    },
    hideHoverEffect(e) {
      e.target.classList.remove('hover-effect-visible');
      this.showLargeCapsule = false;
    },

  },
  components: {
    ScrollingNavbar,
    
  },
};
</script>
  <style scoped>
.nav-item-hover {
  position: relative;
  display: inline-block; /* 确保遮罩跟随文本块 */
}

.nav-item-hover.hover-effect-visible::before {
  content: '';
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: -5px;
  right: -5px;
  background-color: rgba(255, 255, 255, 0.3); /* 减少透明度，使文字更清晰 */
  border-radius: 20px;
  z-index: 1;
  transition: all 0.3s ease;
}

.content {
  height: 2000px;
  background-color: #08a5e8;
}








</style>
  